package org.delphy.indy2.containers.carbonWindowClasses
{
	import mx.controls.Button;
	
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;

	public class CarbonTitleBarCloseButton extends Button
	{
		
		[Bindable]
		public var glowColor:Number;
		
		[Bindable]
		public var glowSize:Number;
		
		public function CarbonTitleBarCloseButton()
		{
			super();
			styleName="carbonTitleBarCloseButton";

			addEventListener(MouseEvent.ROLL_OVER,onRollOver);
			addEventListener(MouseEvent.ROLL_OUT,onRollOut);				
			
		}
		private function onRollOver(evt:MouseEvent):void{
			glowColor=getStyle("glowColor");
			glowSize=getStyle("glowSize");
			
			var glowFilter:GlowFilter=new GlowFilter();
			glowFilter.blurX=glowSize;
			glowFilter.blurY=glowSize;
			glowFilter.alpha=0.75;
			glowFilter.color=glowColor;
			
			filters=[glowFilter];
		}
		private function onRollOut(evt:MouseEvent):void{
			filters=[];
		}	
		
	}
}